<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib uri="/struts-tags" prefix="s" %>    
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html >
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎注册，网上订餐系统</title>
<link href="css/main.css" type="text/css" rel="stylesheet"/>
</head>

<body >
<div id="contain">
  <div id="header">
  	<img src="images/title.png" />
  </div>
  <div id="center">
    <div id="login_box">
      <h1>欢迎注册</h1>
      <form action="regeditAction" method="post"  onsubmit="return check()">
			<input type="text" name="username" id="username" placeholder="请输入用户名" />
			<input type="password" name="password" id="password" placeholder="请输入密码" />
            <input type="submit" class="submit" value="注册" />
		</form>	
 	</div>
  </div>
  <div id="footer">
  	Copyright ©2008-2015 booking.com, All Rights Reserved.
  </div>
</div>
<script>
var regeditError='${regeditError}';
if(regeditError=="注册失败，用户名已存在"){
    alert(regeditError);
    regeditError="";
    }
    

function check(){

	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
	
	if(username == null || username == ""){
		alert("用户名不能为空");
		return false;
	}
	if(password == null || password == ""){
		alert("密码不能为空");
		return false;
	}
	return true;
}

</script>
</body >
</html>
